package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

/**
 * @Author Justin Parker
 * @Date 2024/7/13 0013 15:12
 * @Version 1.0
 *
 *
 */
public class NewForDemo {
    public static void main(String[] args) {
       String[] array = {"one","two","three","four","five"};
       for (String i :array){
           System.out.println(i);
       }

        Collection<String> c =new ArrayList<>();
       c.add("one");
       c.add("two");
       c.add("three");
       c.add("four");
       c.add("five");

        Iterator<String> it = c.iterator();
        while(it.hasNext()){
            String e = it.next();
            System.out.println(e);
        }

        for(String e:c){
            System.out.println(e);
        }

    }
}
